<extend name="Public/base" />
<block name="content">
<div id="content" style="min-width:800px;">
	<div id="content-header">
		<div id="breadcrumb">
			<a href="{:U('Index/index')}" title="首页" class="tip-bottom"><i
				class="icon-home"></i> 首页</a> <a href="#" class="current">{$meta_title}</a>
		</div>
	</div>
	<div class="container-fluid">
		<br>
		<a class="btn btn-info" href="{:U('add')}">新增</a>
		<button class="confirm btn btn-danger ajax-post" url="{:U('Service/change?method=delete')}" target-form="ids">删除</button>
	</div>
	<div class="container-fluid search-form">
			<form class="m-filter" autocomplete="off">
				<div class="clearfix">
					<a class="pull-left btn btn-success btn-filter-show" id="j-filter-show"><span class="icon-chevron-down"></span></a>
				</div>
				
				<div class="filter-box" id="j-filter-box">
					<!-- 基础信息 -->
					<div class="filter-base filter-group">
						<a class="title"><span class="icon-list"></span> 基础信息</a>
						<span class="control-group">
							<select class="form-control" style="width: 140px;" name="activity_id" id="activity_id" onchange="change_merchant(activity_id, '{:U('Shop/getActivityMerchant')}')">
								<option value=0>选择活动</option>
								<volist name="activity_list" id="vo">
									<option value='{$vo.activity_id}'>{$vo.activity_name|strip_tags}</option>
								</volist>
								{$Think.config.ACTIVITY_TTTM}
							</select>
						</span>
						<span class="control-group">
							<select class="form-control" style="width: 140px;" name="merchant_id" id="merchant_id" onchange="change_shop(activity_id,merchant_id, '{:U('Shop/getMerchantShop')}')">
								<option value=0>选择商户</option>
								<volist name="merchant_list" id="vo">
									<option value='{$vo.merchant_id}'>{$vo.merchant_name|strip_tags}</option>
								</volist>
							</select>
						</span>
						<span class="control-group">
							<select class="form-control" style="width: 140px;" name="shop_id" id="shop_id">
								<option value=0>选择店铺</option>
								<volist name="shop_list" id="vo">
									<option value='{$vo.shop_id}'>{$vo.shop_name|strip_tags}</option>
								</volist>
							</select>
						</span>
						<span class="control-group">
							<select class="form-control" style="width: 140px;" name="customer_service_type" id="customer_service_type">
								<option value=0>请选择投诉分类</option>
								<volist name="service_type" id='vo'>
									<option value="{$key}">{$vo|strip_tags}</option>
								</volist>
							</select>
						</span>
						<span class="control-group">
							<select class="form-control" style="width: 140px;" name="customer_service_status" id="customer_service_status">
								<option value=0>请选择处理状态</option>
								<volist name="service_status" id='vo'>
									<option value="{$key}">{$vo|strip_tags}</option>
								</volist>
							</select>
						</span>
					  	<span class="control-group">
							<select class="form-control" style="width: 140px;" name="uid" id="uid">
								<option value=0>请选择处理人</option>
								<volist name="member_list" id="vo">
									<optgroup label="{$vo.team_id|getTeamName}">
										<volist name="vo._child" id="item">
											<option value='{$item.member_id}'>{$item.member_name|strip_tags}</option>
										</volist>
									</optgroup>
								</volist>
							</select>
						</span>
						<span class="control-group">
					      	<input type="text" id="start_time" name="start_time" readonly="readonly" class="datepicker" value="{:strip_tags(I('start_time'))}" placeholder="开始时间" style="width:120px; text-align:center;" >
					    </span>
					  	<span class="control-group">
					      	<input type="text" id="end_time" name="end_time" readonly="readonly" class="datepicker" value="{:strip_tags(I('end_time'))}" placeholder="结束时间" style="width:120px; text-align:center;" >
					  	</span>　
					</div>
					<!-- /基础信息 -->
					<!-- 分类&状态 -->
					<div class="filter-base filter-group">
						<a class="title"><span class="icon-list"></span> 基础信息</a>
					  	<span class="control-group">
							<input type="text" id="customer_service_name" name="customer_service_name"  value="{:strip_tags(I('customer_service_name'))}" placeholder="客户姓名" style="width:140px; text-align:center;" >
						</span>
						<span class="control-group">
							<input type="text" id="customer_service_mobile" name="customer_service_mobile"  value="{:strip_tags(I('customer_service_mobile'))}" placeholder="客户电话" style="width:140px; text-align:center;" >
						</span>
					  	<span class="control-group">
							<input type="text" id="customer_service_order_num" name="customer_service_order_num"  value="{:strip_tags(I('customer_service_order_num'))}" placeholder="纸质订单号" style="width:140px; text-align:center;" >
						</span>
						<span class="control-group">
							<input type="text" id="customer_service_content" name="customer_service_content"  value="{:strip_tags(I('customer_service_content'))}" placeholder="问题与进程" style="width:140px; text-align:center;" >
						</span>
					</div>
					<!-- /分类&状态 -->
					<br>
					<div class="clearfix btn-group">
						<a class="btn btn-success btn pull-left" id="j-filter-hide" style="margin-left:15px;"><span class="icon-chevron-up"></span></a>
						<button type="button" id="search_button" url="{:U('Service/index')}" class="btn btn-primary btn pull-left"><span class="icon-search"></span></button>
					</div>	
				</div>		
			</form>
	</div>
	
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-content">
						<notempty name="_list">
							<table id="config_table" class="table table-bordered table-striped with-check">
								<thead>
									<tr>
										<th width="2%"  class="row-selected">
				                            <input class="checkbox check-all" type="checkbox">
				                        </th>
				                        <th width="4%" class="taskStatus">ID</th>
				                        <th width="5%" class="taskStatus">处理人</th>
				                        <th width="7%" class="taskStatus">客户姓名</th>
				                        <th width="7%" class="taskStatus">联系电话</th>
				                        <th width="7%" class="taskStatus">纸质订单号</th>
				                        <th width="10%" class="taskStatus">活动</th>
				                        <th width="10%" class="taskStatus">商户</th>
				                        <th width="10%" class="taskStatus">店铺</th>
				                        <th width="10%" class="taskStatus">投诉分类</th>
				                        <th width="6%" class="taskStatus">处理状态</th>
				                        <th width="10%" class="taskStatus">创建时间</th>
				                        <th width="12%" class="taskStatus">操作</th>
									</tr>
								</thead>
								<tbody>
						                <volist name="_list" id="menu">
						                    <tr>
						                        <td><input class="ids row-selected" type="checkbox" name="id[]" value="{$menu.customer_service_id}" class="ids" /></td>
						                        <td class="taskStatus">{$i}</td>
						                        <td class="taskStatus">{$menu.uid|getUserName|htmlspecialchars}</td>
						                        <td class="taskStatus">{$menu.customer_service_name|htmlspecialchars}</td>
						                        <td class="taskStatus">{$menu.customer_service_mobile|htmlspecialchars}</td>
						                        <td class="taskStatus">{$menu.customer_service_order_num|htmlspecialchars}</td>
						                        <td class="taskStatus">{$menu.activity_id|getActivityName|htmlspecialchars}</td>
						                        <td class="taskStatus">{$menu.merchant_id|getMerchantName|htmlspecialchars}</td>
						                        <td class="taskStatus">{$menu.shop_id|getShopName|htmlspecialchars}</td>
						                        <td class="taskStatus">{$service_type[$menu['customer_service_type']]|htmlspecialchars}</td>
						                        <td class="taskStatus">
							                        <if condition="$menu['customer_service_status'] eq 1"><font color="#FF0000">{$service_status[$menu['customer_service_status']]|htmlspecialchars}</font></if>
							                        <if condition="$menu['customer_service_status'] eq 2"><font color="#006dcc">{$service_status[$menu['customer_service_status']]|htmlspecialchars}</font></if>
							                        <if condition="$menu['customer_service_status'] eq 3"><font color="#666666">{$service_status[$menu['customer_service_status']]|htmlspecialchars}</font></if>
						                        </td>
						                        <td class="taskStatus">{$menu.create_time|time_format="Y-m-d H:i:s"}</td>
						                        <td class="taskStatus">
						                            <a title="编辑" href="{:U('edit?id='.$menu['customer_service_id'])}"><i class="icon-pencil"></i> 编辑</a> 　
						                            <a class="confirm ajax-get" title="删除" href="{:U('change',array('id'=>$menu['customer_service_id'],'method'=>'delete'))}"><i class="icon-remove"></i> 删除</a>
						                        </td>
						                    </tr>
						                </volist>
								</tbody>
							</table>
							<div class="dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_full_numbers" id="DataTables_Table_0_paginate">
								{$_page}
							</div>
						<else/>
							<center>暂无内容</center>
						</notempty>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(function (){
	//日期控件
	$(".datepicker").datetimepicker({
		format: 'yyyy-mm-dd hh:ii', 
	    autoclose: true,
	    todayBtn: true
	});
	//条件框
	$("#j-filter-hide").click(function(){
		$("#j-filter-box").fadeOut(300);
		$("#j-filter-show").fadeIn(300);
	});
	$("#j-filter-show").click(function(){
		$("#j-filter-box").fadeIn(300);
		$(this).fadeOut(300);
	});
	
	set_value("activity_id",'{:I('activity_id')}')
	set_value("merchant_id",'{:I('merchant_id')}')
	set_value("shop_id",'{:I('shop_id')}')
	set_value("customer_service_type",'{:I('customer_service_type')}')
	set_value("customer_service_status",'{:I('customer_service_status')}')
	set_value("uid",'{:I('uid')}')
	//clear
	
	$('#b_time').click(function(){
		$('#start_time,#end_time').val('');
	});
	//默认活动
	/* if("0" != "{:C('JJHH_ACTIVITY_ID')}" && "{:I('activity_id')}"==0){
		set_value('activity_id', "{:C('JJHH_ACTIVITY_ID')}");
		change_merchant(activity_id, "{:U('Shop/getActivityMerchant')}");
	} */
});

//导航高亮
highlight_subnav("{:U('Service/index')}");//导航高亮
</script>
</block>